home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
s85xx
/
s8507b.d64
/
runge kutta
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
507b
|
23 lines
100 PRINT"[147] RUNGE-KUTTA-VERFAHREN OHNE LOK. FEHLER [146]"
110 PRINT"DGL AM PROGRAMMENDE EINGEBEN!"
120 INPUT"SCHRITTWEITE ";H
130 INPUT"ANFANGSWERT ";Y0
140 INPUT"INTERV.GRENZEN";A,B
150 DEFFNR(X)=INT(X*1E4+.5)/1E4
160 PRINT" X"," Y"
170 YK=Y0
180 XK=A
190 GOSUB250
200 YL=YK+(H/6)*(L1+2*L2+2*L3+L4)
210 PRINTFNR(XK),YK
220 XK=XK+H:YK=YL
230 IFXK<=B+HTHEN190
240 END
250 X=XK:Y=YK:GOSUB300:L1=F
260 X=XK+H/2:Y=YK+(H/2)*L1:GOSUB300:L2=F
270 X=XK+H/2:Y=YK+(H/2)*L2:GOSUB300:L3=F
280 X=XK+H:Y=YK+H*L3:GOSUB300:L4=F
290 RETURN
300 F=Y*X-2*X :REM <=> Y'=... _DGL
310 RETURN